package com.oop;

/**
 * @author caizhengjun
 * @date 2020/9/4 5:35 下午
 */
public class OOPTest03 {

    //引用数据类型的参数传递
    public static void main(String[] args) {
        Person person = new Person();//474
        person.age = 5;

        System.out.println("修改之前 age = " + person.age);

        change(person);

        System.out.println("修改之后 age = " + person.age);
    }

    private static void change(Person person) {
        System.out.println("change 修改之前 age = " + person.age);
        person.age = 3;
        System.out.println("change 修改之后 age = " + person.age);
    }
}

class Person {
    int age;
}
